import { Injectable, NestMiddleware, Query } from '@nestjs/common';
import { Request, Response, NextFunction } from 'express';
@Injectable()
export class Loginmiddleware implements NestMiddleware {
  use(@Query() req: Request, res: Response, next: NextFunction) {
    console.log('测试中间件');
    if (req.query.name != 'yui') {
      res.send({ y: '不是yui' });
      return;
    } else {
      next();
    }
  }
}
